package classesBancodeDados;

import classesMiolo.FichaKey;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;

@Entity
@IdClass(FichaKey.class)
public class FichaObservacaoPA implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    private String nPront;
    @Id
    private String sus;

    private String dataEntrada;
    private String dataAlta;
    private String cidDiag;
    private int qtdDiarias;
    private String procedimento;
    private String obs;

    public FichaObservacaoPA(String nPront, String sus, String dataEntrada,
                             String dataAlta, String cidDiag, int qtdDiarias,
                             String procedimento, String obs) {
        this.nPront = nPront;
        this.sus = sus;
        this.dataEntrada = dataEntrada;
        this.dataAlta = dataAlta;
        this.cidDiag = cidDiag;
        this.qtdDiarias = qtdDiarias;
        this.procedimento = procedimento;
        this.obs = obs;
    }
    
    public FichaObservacaoPA() {
        this.nPront = "";
        this.sus = "";
        this.dataEntrada = "";
        this.dataAlta = "";
        this.cidDiag = "";
        this.qtdDiarias = 0;
        this.procedimento = "";
        this.obs = "";
    }
    
    public String getNumeroProntuario() {
        return nPront;
    }

    public void setNumeroProntuario(String nPront) {
        this.nPront = nPront;
    }

    public String getSus() {
        return sus;
    }

    public void setSus(String sus) {
        this.sus = sus;
    }

    public String getDataEntrada() {
        return dataEntrada;
    }

    public void setDataEntrada(String dataEntrada) {
        this.dataEntrada = dataEntrada;
    }

    public String getDataAlta() {
        return dataAlta;
    }

    public void setDataAlta(String dataAlta) {
        this.dataAlta = dataAlta;
    }

    public String getCidDiag() {
        return cidDiag;
    }

    public void setCidDiag(String cidDiag) {
        this.cidDiag = cidDiag;
    }

    public int getQtdDiarias() {
        return qtdDiarias;
    }

    public void setQtdDiarias(int qtdDiarias) {
        this.qtdDiarias = qtdDiarias;
    }

    public String getProcedimento() {
        return procedimento;
    }

    public void setProcedimento(String procedimento) {
        this.procedimento = procedimento;
    }

    public String getObs() {
        return obs;
    }

    public void setObs(String obs) {
        this.obs = obs;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (nPront != null ? nPront.hashCode() : 0);
        hash += (sus != null ? sus.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FichaObservacaoPA)) {
            return false;
        }
        FichaObservacaoPA other = (FichaObservacaoPA) object;
        if ((this.nPront == null && other.nPront != null) || (this.nPront != null && !this.nPront.equals(other.nPront))) {
            return false;
        }
        if ((this.sus == null && other.sus != null) || (this.sus != null && !this.sus.equals(other.sus))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "classesBancodeDados.FichaObservacaoPA[ nPront=" + nPront + ", sus=" + sus + " ]";
    }
    
}
